go to previous page   go to home page   go to next page

Answer:

grph.drawLine(  0, 149, 199, 0 )

Since the height is 150, and the numbering of pixels starts at zero, the Y coordinate of the lower left corner is 149.


Compiling Applets

As far as the compiler is concerned, the source file for an applet is just another object definition. It does not matter that the object is an applet. So the compiler works the same as it does with applications. To compile the above applet do this:

C:\> javac JustOneCircle.java

This creates JustOneCircle.class in your directory.

If you want, you can copy the above source code into an editor, save it to JustOneCircle.java, and compile it. You will not be able to run it in the usual way, however.


QUESTION 10:

Why won't

C:\> java JustOneCircle

work to run the applet?